package com.sgzn.sgpay.service.converter;

import com.sgzn.sgpay.model.response.result.MerchantInfo;
import com.sgzn.sgpay.persistence.domain.TMerchant;
import com.sgzn.sgpay.persistence.domain.TMerchantAccount;

/**
 * 商户管理相关响应转换器
 * @author zhongzhongyong
 * @version Id: MerchantResponseConverter.java, v 0.1 2018/4/17 22:37 zhongzhongyong Exp $$
 */
public class MerchantResponseConverter {

    /**
     * 组装商户信息响应实体
     * @param tMerchant
     * @param tMerchantAccount
     * @return
     */
    public static MerchantInfo assembleMerchantInfo(TMerchant tMerchant,TMerchantAccount tMerchantAccount){
        MerchantInfo merchantInfo = new MerchantInfo();
        merchantInfo.setMerchantId(tMerchant.getMerchantId());
        merchantInfo.setMerchantName(tMerchant.getMerchantName());
        merchantInfo.setMerchantOwner(tMerchant.getMerchantOwner());
        merchantInfo.setContact(tMerchant.getContact());
        merchantInfo.setPassword(tMerchant.getPassword());
        merchantInfo.setAccountId(tMerchantAccount.getAccountId());
        merchantInfo.setAccountAmount(tMerchantAccount.getAccountAmount());
        merchantInfo.setSettleAmount(tMerchantAccount.getSettleAmount());
        merchantInfo.setPreAmount(tMerchantAccount.getPreAmount());
        merchantInfo.setAccountState(tMerchantAccount.getAccountState());
        merchantInfo.setBankCardNo(tMerchant.getBankCardNo());
        return merchantInfo;
    }
}
